package com.my12306.common.enums;

import com.my12306.common.util.response.ResponseCode;

/**
 * @Author:苏牧夕
 * @Date:2020/5/13 14:38
 * @Version 1.0
 */
public enum CodeEnum implements ResponseCode {
    UNKNOW_EXCEPTION(500, "系统未知异常"),
    SQL_EXECPTION(502, "操作数据库异常"),
    VALID_Exception(503, "参数校验失败"),
    SUCCESS(0, "操作成功!"),
    FAIL(1, "操作失败！"),
    ADD_FAIL(101, "添加失败"),
    UPDATE_FAIL(102, "修改失败"),
    DELETE_FAIL(103, "删除失败"),
    FORBIDDEN(403, "权限不足"),
    SMS_FAIL(103, "发送短信失败，请重新尝试！"),
    SMS_FAILNUMBER(104, "你今天的发送验证码次数已用完，请明天再试！"),
    UNAUTHORIZATION(401, "未授权或token失效");
    private int code;
    private String message;

    CodeEnum() {
    }

    CodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public int getCode() {
        return code;
    }
}
